package com.aegean.MonitorExamSYS.android.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.aegean.MonitorExamSYS.android.business.AndroidBusiness;
import com.aegean.MonitorExamSYS.android.component.ExamineeExam;
import com.opensymphony.xwork2.ActionSupport;

@Controller("UserPositionSelectForAndroid")
@Scope("prototype")
public class UserPositionSelectForAndroid extends ActionSupport {
	@Resource
	AndroidBusiness business;
	private int pageNow;// 当前页
	private int totalRows;// 总条例个数
	private int pageCount;// 页数
	private int start;
	private int limit;
	private int user_Id;
	private List<ExamineeExam> exams;
	public List<ExamineeExam> getExams() {
		return exams;
	}

	public void setExams(List<ExamineeExam> exams) {
		this.exams = exams;
	}

	public int getPageNow() {
		return pageNow;
	}

	public void setPageNow(int pageNow) {
		this.pageNow = pageNow;
	}

	public int getTotalRows() {
		return totalRows;
	}

	public void setTotalRows(int totalRows) {
		this.totalRows = totalRows;
	}

	public int getPageCount() {
		return pageCount;
	}

	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}

	public int getStart() {
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public int getLimit() {
		return limit;
	}

	public void setLimit(int limit) {
		this.limit = limit;
	}

	public int getUser_Id() {
		return user_Id;
	}

	public void setUser_Id(int user_Id) {
		this.user_Id = user_Id;
	}
	@Override
	public String execute() throws Exception {
		if(limit==0){
			limit=6;
		}
		totalRows=business.showExamListCount(user_Id);
		exams = business.showExamList(user_Id, start, limit);
		return SUCCESS;
	}
}
